<template>
  <div class="header">
    <div class="search">
      <div class="search-left">
        <img src="../../../assets/search.png" alt="">
        <input type="text" :placeholder="placeholderTip" v-model="name">
      </div>
      <div class="search-right" @click="search()">搜索</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "guibintinghead",
    props: {
      activeIndex: {type: Number}
    },
    data() {
      return {
        name: ''
      }
    },
    methods: {
      search() {
        let params = {name: this.name};
        this.$emit("goSearch", params);
      },
      cleanParams() {
        this.name = '';
      }
    },
    computed: {
      placeholderTip() {
        if (this.activeIndex == 0) {
          return '按名称搜索';
        }
        if (this.activeIndex == 1) {
          return '按名称搜索';
        }
        if (this.activeIndex == 2) {
          return '按名称搜索';
        }
      }
    }
  }
</script>

<style scoped lang="less" rel="stylesheet/less">
  .header {
    display: flex;
    padding: 10px 16px;
    position: relative;
    background-color: #ffffff;
    overflow: visible;
    z-index: 2;

    .search {
      position: relative;
      display: flex;
      justify-content: space-between;
      align-content: center;
      width: calc(100%);

      .search-left {
        display: flex;
        justify-content: flex-start;
        align-content: center;
        width: 90%;
        padding: 10px 16px;
        box-sizing: border-box;
        background: #F7F8FA;
        border-radius: 18px;

        img {
          width: 12px;
          height: 12px;
          margin-right: 4px;
        }

        input {
          width: 100%;
          font-size: 12px;
          line-height: 13px;
          background: none;
          border: none;
        }

        input::-webkit-input-placeholder {
          color: #BBBBBB;
        }

        input:hover {
          border: none;
        }
      }

      .search-right {
        line-height: 33px;
        font-size: 14px;
        color: #2890EE;
      }
    }
  }

  .panel .cell-icon {
    margin-right: 10px;
    vertical-align: middle;
  }

  .panel .shou {
    margin-left: 10px;
  }

  .content {
    display: flex;
    text-align: left;
    padding: 13px 0 10px;
    margin: 0 10px;
    border-bottom: 1px solid #eee;

    p {
      flex: 0 125px;
      margin-right: 10px;

      img {
        border-radius: 7px;
      }
    }

    ul {
      li {
        font-size: 12px;
        color: #999;
      }

      li:nth-child(2) {
        margin: 7px 0;
      }

      li:first-child {
        font-size: 15px;
        color: #111;
      }

      img {
        vertical-align: middle;
        margin-right: 10px;
      }
    }

  }

  .content:last-child {
    border-bottom: none;
  }

</style>


